<?php    
      if(isset($_POST["body"]))
      {
        $title = $_POST["title"];
        $body = $_POST["body"]; 
        $body = nl2br($body);
        $tags = $_POST["tags"];        
        $poster = $_POST["poster"];
        
        $error = 0;
        if($title == '')
        {
            trace("You forgot to add a title please go back and do it again");
            $error = 1;  
        } 
        
        if($body == '')
        {
            trace("You forgot to add content please go back and do it again");
            $error = 1;    
        }
        
        if($error)
            exit();
        
        if(mysql_query("UPDATE news SET title = '$title', body = '$body', tags = '$tags', poster = '$poster'"))
        {
            trace("News edited");   
        }
        else
        {
            trace("Error editing news");
            trace(mysql_error());   
        }
        exit();   
      }
?>
<?php 
    $row = mysql_fetch_array($selectNewsID);
    $title = $row[title];
    $body = $row[body];
    $tags = $row[tags];
    trace($title);
?>
<form method="post" class="news">
    <input type="text" name="title" id="title" class="req" value="<?php echo $title ?>" display="Title"/>
    <br />
    <textarea name="body" cols="20" rows="10" id="body" class="req" display="Content"><?php echo $body ?></textarea>
    <br />
    <input type="text" name="tags" value='<?php echo $tags ?>'/>
    <br />
    <input type="submit" value="Submit" id="submitBtn" class="news"/>
</form>